"""
【练习】固定数值计算
对数字列表中数字的求和，求平均值，求最大值，求最小值
"""

def regular_num(list):
    sum_num = 0
    max_num = list[0]
    min_num = list[0]
    length_l = len(list)
    for i in list:
        sum_num += i
        if i > max_num:
            max_num = i
        elif i < min_num:
            min_num = i
    avg_num = sum_num / length_l
    return f'列表中数字之和为{sum_num},最大值为{max_num},最小值为{min_num},平均值为{avg_num}'

